package net.rlair.sbdemo.aspect;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * 切面类.
 *
 * @author li gu
 */
@Component
@Aspect
@Order(2)
public class LiGu1 {

    @Pointcut("execution(public * net.rlair.sbdemo.controller.ZhaozichenController.list())")
    public void pointCut(){}

    @Before("pointCut()")
    public void before(){
        System.out.println("ligu1 before ...");
    }

    @After("pointCut()")
    public void after() {
        System.out.println("ligu1 after...");
    }

    @AfterThrowing("pointCut()")
    public void afterThrowing() {
        System.out.println("ligu1 afterThrowing...");
    }

}
